package com.vueperson.vueperson.services.handle;

import com.vueperson.vueperson.dao.RoleJPA;
import com.vueperson.vueperson.dao.RoleJPA02;
import com.vueperson.vueperson.dao.UserJPA;
import com.vueperson.vueperson.dao.UserJPA02;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class Role01_2 extends Role01 implements Role2 {
@Autowired
    UserJPA userJPA;
    @Autowired
    RoleJPA roleJPA;
    @Autowired
    UserJPA02 userJPA02;
    @Autowired
    RoleJPA02 roleJPA02;
    @Override
    public void saveRole(String name, String nameZh) {

    }

    @Override
    public void saveUser(String username, String password, String roleName) {

    }
   public  Boolean haveUser(String name){
       Boolean f;
       if (userJPA.findByUsername(name).size()!=0){
           System.out.println("已有用户名");
           return f=true;
       };
        return f=false;
    }



    public  Boolean haveRole(String name){
        Boolean f;
        if (roleJPA.findByName(name).size()!=0){
            System.out.println("已经有此角色");
            return f=true;
        };
        return f=false;
    }
}
